using System;
using InfoTech.Mvc.Core.Models;
using InfoTech.Utilities.Reflection;
using System.ComponentModel.DataAnnotations;
using InfoTech.Mvc.Core.UI.Validation;
using InfoTech.LanTranh.MucVu.Bussiness;

namespace InfoTech.Mvc.LanTranh.MucVu.Models
{
	[Serializable]
	public partial class EXCEPTIONModel : ObjModel<EXCEPTION>, IModelConverter
	{

		#region Constructor

		public EXCEPTIONModel()
			: base()
		{
		}

		public EXCEPTIONModel(EXCEPTION obj)
			: base(obj)
		{
		}

		#endregion

		#region Fields

		private System.Guid? _exceptionid;

		private System.Int32? _updatetype;

		private System.String _title;

		private System.String _message;

		private System.DateTime? _dateadd;

		private System.Int32? _resulttype;

		#endregion

		#region Properties

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? EXCEPTIONID
		{
			get
			{
				return _exceptionid;
			}
			set
			{
				_exceptionid = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Int32? UPDATETYPE
		{
			get
			{
				return _updatetype;
			}
			set
			{
				_updatetype = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		[StringLength(1000, ErrorMessage= "Value must be under 1000 characters")]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.String TITLE
		{
			get
			{
				return _title;
			}
			set
			{
				_title = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		[StringLength(1073741823, ErrorMessage= "Value must be under 1073741823 characters")]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.String MESSAGE
		{
			get
			{
				return _message;
			}
			set
			{
				_message = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.DateTime? DATEADD
		{
			get
			{
				return _dateadd;
			}
			set
			{
				_dateadd = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Int32? RESULTTYPE
		{
			get
			{
				return _resulttype;
			}
			set
			{
				_resulttype = value;
			}
		}

		#endregion

		#region IModelConverter

		public System.Type Reflector()
		{
			return typeof(EXCEPTIONModel);
		}
		public object GetModel()
		{
			return this;
		}

		#endregion

		#region Overrides of Model<EXCEPTION>

		public override void ReverttoModel()
		{
			CreateModel(this);
		}

		public override EXCEPTION ReverttoBussiness()
		{
			return CreateBussiness(this);
		}

		#endregion

		#region Operators

		public static implicit operator EXCEPTIONModel(EXCEPTION obj)
		{
			return new EXCEPTIONModel(obj);
		}
		public static implicit operator EXCEPTION(EXCEPTIONModel obj)
		{
			return obj.ReverttoBussiness();
		}

		#endregion

	}
}
